#{extends 'main.html' /}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="pt-BR">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  </head>
  <body>
  <div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
  {lang: 'pt-BR'}
</script>
<h2>Visualização de Imóvel</h2>
<hr style="margin-top: 0" />
<div class="span2 well pull-center">
<img src="@{mostrarFoto1(imovel.id)}"/><hr>
<img src="@{mostrarFoto2(imovel.id)}"/><hr>
<img src="@{mostrarFoto3(imovel.id)}"/>
</div>
<div class="span6 well">
#{if u}
#{form @marcarFavorito(imovel.id),method:'POST',class:'form-horizontal',enctype:'multipart/form-data'}
<p><a class="tt" title="Marcar Favorito"  href="#{if favorito}@{desmarcarFavorito(imovel.id)}#{/if}#{else}@{marcarFavorito(imovel.id)}#{/else}"><i class="${favorito==true?'icon-star':'icon-star-empty'}"></i></a></p>
#{/form}
#{/if}
<p>Descrição: <strong>${imovel.descricao}</strong></p>
<P>Tipo do imóvel: ${imovel.tipoImovel.descricao}</P>
<p>Cidade: ${imovel.bairro.cidade.descricao} / ${imovel.bairro.cidade.estado.descricao}</p>
<p>Bairro: ${imovel.bairro.descricao}</p>
<p>Transação: ${imovel.transacao.descricao}</p>
<p>Valor: ${imovel.valor}</p>
<p>Quartos: ${imovel.quartos}</p>
<p>Suites: ${imovel.suites}</p>
<p>Vagas de Garagem: ${imovel.vagasGaragem}</p>
<p>IPTU: ${imovel.iptu}</p>
<p>Condominio: ${imovel.condominio}</p>
<p>CEP: ${imovel.cep}</p>
<p>Largura: ${imovel.largura} m</p>
<p>Comprimento: ${imovel.comprimento} m </p>
<p>Área Total: ${imovel.areaTotal} m² </p>
<p>Tratar com: ${imovel.usuario.nome}</p>
<p>Telefone para contato: ${imovel.usuario.telefone}</p>
<p>Caracteristicas:</p> #{list caracteristica, as:'ca'}
<ul>
<li>${ca.descricao} </li>
</ul>
#{/list}
<p class="pull-right">
</p></div>
<div class="span1 well pull-center">
<p>
<div class="fb-like" data-href="http://localhost:9000@{imovels.mostrar(imovel.id)}" data-send="true" data-layout="box_count" data-width="450" data-show-faces="true" data-font="arial"></div>
</p>
<p>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://localhost:9000@{imovels.mostrar(imovel.id)}" data-hashtags="MeuCafofo" data-text="${imovel.tipoImovel.descricao} de ${imovel.quartos} quartos em ${imovel.bairro.descricao}" data-lang="en" data-related="anywhereTheJavascriptAPI" data-count="vertical" data-via="SiteMeuCafofo" >Tweet</a>
</p>
<p>
<div class="g-plusone" data-size="tall" data-href="http://localhost:9000@{imovels.mostrar(imovel.id)}"></div>
</p>
</div>
<div class="span8 well">
#{list comentario, as: 'coment'}
<p>Comentario de ${coment.usuario.nome}: <strong>${coment.comentario}</strong></p>
#{/list}
#{ifnot session.get('username')}
<P>Para comentar, faça login ou registre-se no meu cafofo.</P>
#{/ifnot}
#{else}
#{form @AdicionarComentario(imovel.id),method:'POST',class:'form-horizontal',enctype:'multipart/form-data'}
#{field 'comentario.comentario'}
          <div class="control-group ${errors.forKey(field.name)?'error':''}">
            <label for="${field.name}" class="control-label">Comente aqui...</label>
            <div class="controls">
              <textarea name="${field.name}" class="input-large span7" style="height:100px;">${field.value}</textarea>
              <span class="help-inline">${errors.forKey(field.name)}</span>
            </div>
          </div>
          #{/field}
			<div class="form-actions">
            <button class="btn btn-primary" type="submit" >Add</button>
          </div>
#{/form}
		#{field 'imovel.id'}
          	<input type="hidden" name="${field.name}" value="${field.value}">
          #{/field}
          #{/else}
<p class="pull-right">
</p></div>
</body>
</html>